﻿using System.Data.SqlServerCe;

namespace SeventhHabit.Dbm.Model {
    public class SqlCeDatabase : VersionedDatabaseBase {
        #region C'tors

        public SqlCeDatabase(string connectionString) : base(connectionString) {
            using (var connection = new SqlCeConnection(ConnectionString)) {
                if (SchemaChangeLogTableExists(connection))
                    RetrieveReleaseNumbers(connection);
            }
        }

        #endregion

        #region IVersionedDatabase Members

        public override void ExecuteScripts(string[] sqlScripts, bool transactional) {
            using (var connection = new SqlCeConnection(ConnectionString))
                ExecuteScriptsBase(connection, sqlScripts, transactional);
        }

        #endregion
    }
}